package com.xuecheng.framework.domain.course;

import com.xuecheng.framework.domain.course.validator.coursebase.IsGrade;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;

/**
 * Created by admin on 2018/2/10.
 */
@Data
@ToString
@Entity
@Table(name="course_base")
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
@ApiModel(value = "课程基本信息实体类")
public class CourseBase implements Serializable {

    @Id
    @GeneratedValue(generator = "jpa-uuid")
    @Column(length = 32)
    @ApiModelProperty(name = "id",value = "课程id")
    private String id;
    @NotEmpty(message = "课程名不能为空")
    @ApiModelProperty(name = "name",value = "课程名")
    private String name;
    @ApiModelProperty(name = "user",value = "适用人群")
    private String users;
    @NotEmpty(message = "大分类不能为空")
    @ApiModelProperty(name = "mt",value = "大分类")
    private String mt;
    @NotEmpty(message = "小分类不能为空")
    @ApiModelProperty(name = "st",value = "小分类")
    private String st;
    @IsGrade() // 自定义校验规则
    @ApiModelProperty(name = "grade",value = "课程等级")
    private String grade;
    @NotEmpty(message = "学习模式不能为空")
    @ApiModelProperty(name = "studymodel",value = "学习模式")
    private String studymodel;
    @ApiModelProperty(name = "teachmode",value = "教学模式")
    private String teachmode;
    @NotEmpty(message = "课程介绍不能为空")
    @ApiModelProperty(name = "description",value = "课程介绍")
    private String description;
    @ApiModelProperty(name = "status",value = "状态")
    private String status;
    @Column(name="company_id")
    @ApiModelProperty(name = "companyId",value = "所属公司id")
    private String companyId;
    @Column(name="user_id")
    @ApiModelProperty(name = "userId",value = "所属用户id")
    private String userId;

}
